Description:
AFP detects the code that assigns to a method parameter. This includes modifications made to the parameter with increment or decrement operators.
Incorrect:
function Client.discount(inputVal, quantity, yearToDate: integer) : integer;
begin
if inputVal > 50 then
begin
inputVal := inputVal - 50;
end;
...
end;
Correct:
function Client.discount(inputVal, quantity, yearToDate: integer) : integer;
var tmp: integer;
begin
tmp := inputVal;
if tmp > 50 then
begin
tmp := tmp - 50;
end;
...
end;